package com.ruoyi.flow.flow.deployment;

import com.ruoyi.flow.flow.model.FlowModelService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.impl.persistence.entity.DeploymentEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by fenghuo on 2018/8/28.
 */
@Service
public class FlowDeploymentService {
    private static final Logger LOGGER = LoggerFactory.getLogger(FlowModelService.class);
    @Autowired
    private RepositoryService repositoryService;

    public DeploymentEntity getDeploymentByDefinitionKey(String definitionKey) {
        return (DeploymentEntity) repositoryService.createDeploymentQuery().processDefinitionKey(definitionKey).singleResult();
    }


}
